Skip to content

test(exceptions): remove #[CoversClass] from exception test to fix PH…#13

Merged
walmir-silva merged 1 commit intomainfrom
develop
Mar 5, 2026
Merged

test(exceptions): remove #[CoversClass] from exception test to fix PH…#13
walmir-silva merged 1 commit intomainfrom
develop

Conversation

@walmir-silva
Copy link
Copy Markdown
Contributor

…PUnit 12 CI warning

In PHPUnit 12 + pcov, classes that directly extend a native PHP class (\RuntimeException) are reported as 'not a valid target for code coverage'.

This generates 4 PHPUnit warnings — one per test method — which with the devkit-generated failOnWarning="true" in phpunit.xml.dist cause exit code 1, blocking the CI pipeline despite 100% coverage and 175 passing tests.

Fix: remove #[CoversClass(InvalidRuleException::class)] and #[CoversClass(SanitizationException::class)] from SanitizationExceptionsTest. Coverage for both exception classes is still achieved transitively via SanitizerEngineTest, InMemoryRuleRegistryTest, and integration tests.

…PUnit 12 CI warning

In PHPUnit 12 + pcov, classes that directly extend a native PHP class
(\RuntimeException) are reported as 'not a valid target for code coverage'.

This generates 4 PHPUnit warnings — one per test method — which with the
devkit-generated failOnWarning="true" in phpunit.xml.dist cause exit code 1,
blocking the CI pipeline despite 100% coverage and 175 passing tests.

Fix: remove #[CoversClass(InvalidRuleException::class)] and
#[CoversClass(SanitizationException::class)] from SanitizationExceptionsTest.
Coverage for both exception classes is still achieved transitively via
SanitizerEngineTest, InMemoryRuleRegistryTest, and integration tests.
@walmir-silva walmir-silva merged commit d9c2332 into main Mar 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant